﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace NetworkEasyShare
{
    public partial class trayIcon : Form
    {
        public trayIcon()
        {
            InitializeComponent();
        }

        private void closeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
            App.Current.Shutdown();
        }

        #region Settings Dialog

        private void ShowSettings()
        {
            Settings settingsDialog = new Settings();
            settingsDialog.ShowDialog();
            settingsDialog = null;
        }

        private void settingsToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            Thread settingsThread = new Thread(new ThreadStart(ShowSettings));
            settingsThread.SetApartmentState(ApartmentState.STA);
            settingsThread.Start();
        }
        #endregion

        #region SendFile Dialog

        private void ShowSendFile()
        {
            sendFile sendFileDialog = new sendFile();
            sendFileDialog.ShowDialog();
            sendFileDialog = null;
        }

        private void sendFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Thread sendFileThread = new Thread(new ThreadStart(ShowSendFile));
            sendFileThread.SetApartmentState(ApartmentState.STA);
            sendFileThread.Start();
        }
        #endregion
    }
}
